package com.jeegit.ecms.service.impl;

import java.util.List;
import com.jeegit.common.utils.DateUtils;
import com.jeegit.common.utils.IdUtils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jeegit.ecms.mapper.CmsSiteMapper;
import com.jeegit.ecms.domain.CmsSite;
import com.jeegit.ecms.service.ICmsSiteService;

import com.jeegit.common.core.text.Convert;

/**
 * 站点设置Service业务层处理
 * 
 * @author jeegit
 * @date 2022-06-24
 */
@Service
public class CmsSiteServiceImpl implements ICmsSiteService 
{
    @Autowired
    private CmsSiteMapper cmsSiteMapper;

    /**
     * 查询站点设置
     * 
     * @param id 站点设置主键
     * @return 站点设置
     */
    @Override
    public CmsSite selectCmsSiteById(Long id)
    {
        return cmsSiteMapper.selectCmsSiteById(id);
    }

    /**
     * 查询站点设置列表
     * 
     * @param cmsSite 站点设置
     * @return 站点设置
     */
    @Override
    public List<CmsSite> selectCmsSiteList(CmsSite cmsSite)
    {
        return cmsSiteMapper.selectCmsSiteList(cmsSite);
    }

    /**
     * 新增站点设置
     * 
     * @param cmsSite 站点设置
     * @return 结果
     */
    @Override
    public int insertCmsSite(CmsSite cmsSite)
    {
    	cmsSite.setId(IdUtils.getInstance(1l).nextId());
    	cmsSite.preInsert(cmsSite);
        return cmsSiteMapper.insertCmsSite(cmsSite);
    }

    /**
     * 修改站点设置
     * 
     * @param cmsSite 站点设置
     * @return 结果
     */
    @Override
    public int updateCmsSite(CmsSite cmsSite)
    {
    	cmsSite.preUpdate(cmsSite);
        return cmsSiteMapper.updateCmsSite(cmsSite);
    }

    /**
     * 批量删除站点设置
     * 
     * @param ids 需要删除的站点设置主键
     * @return 结果
     */
    @Override
    public int deleteCmsSiteByIds(String ids)
    {
        return cmsSiteMapper.deleteCmsSiteByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除站点设置信息
     * 
     * @param id 站点设置主键
     * @return 结果
     */
    @Override
    public int deleteCmsSiteById(Long id)
    {
        return cmsSiteMapper.deleteCmsSiteById(id);
    }
}
